package com.sun.dailyprj.androidx.data_binding.cases.db.entity;

import com.sun.dailyprj.androidx.data_binding.cases.db.model.Product;

import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

/*
 * =====================================================================================
 * Summary:
 *
 * File: ProductEntity.java
 * Author: Yanpeng.Sun
 * Create: 2019/5/14 11:35
 * =====================================================================================
 */
@Entity(tableName = "products")
public class ProductEntity implements Product{
    @PrimaryKey
    private int id;
    private String name;
    private String description;
    private int price;


    @Override
    public int getId() {
        return 0;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public String getDescription() {
        return null;
    }

    @Override
    public int getPrice() {
        return 0;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Ignore
    public ProductEntity(int id, String name, String description, int price) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.price = price;
    }

    public ProductEntity(ProductEntity productEntity) {
        this.id = productEntity.getId();
        this.name = productEntity.getName();
        this.description = productEntity.getDescription();
        this.price = productEntity.getPrice();
    }


}
